package base.thread_JUC2.chapter01.demo001;

public class Calculator implements Runnable{

    private int num;
    public Calculator(int num){
        this.num = num;
    }

    @Override
    public void run() {
        for (int i = 1; i <= 9; i++) {
//            System.exit(0);//任一线程结束虚拟机，程序退出
//            try {
//                if (i==5) {
//                    Thread.sleep(5000);
//                }
//            } catch (InterruptedException e) {
//                e.printStackTrace();
//            }
            System.out.printf("%s: %d * %d = %d \n",Thread.currentThread().getName(), num, i, num * i);
        }
    }

}
